#include <iostream>
#include <vector>
using namespace std;

int main() {
    string str("abcd12345ed125ss123");
    
    vector<string> v;
    int len = str.size();
    int begin = 0, end = 0;
    string s;
    for (int i = 0; i < len; ++i)
    {

        if (str[i] >= '0' && str[i] <= '9')
        {

            s.push_back(str[i]);
        }
        else {
            if (!s.empty())
                v.push_back(s);
            s.clear();
        }
    }

    if (!s.empty())
        v.push_back(s);
    for (int i = 0; i < v.size(); ++i) {
        for (int j = 1; j < v[i].size(); ++j)
        {
            if (v[i][j] - v[i][j - 1] != 1)
            {
                v[i].clear();
                break;
            }
        }
    }
    int maxi = 0;
    int max = v[0].size();
    for (int i = 0; i < v.size(); ++i)
    {
        if (max < v[i].size())
        {
            maxi = i;
            max = v[i].size();
        }
    }
    cout << v[maxi] << endl;
}
